package com.qf58.search.exception;

import com.qf58.search.pub.APICode;

import java.io.Serializable;

public class APIException extends RuntimeException implements Serializable {

	public int code;
	public String msg;

	public APIException(String msg) {
		super(msg);
	}

	public APIException(int code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public APIException(APICode apiCode) {
		this(apiCode.getCode(), apiCode.getMsg());
	}



	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setAPICode(APICode apiCode) {
		this.code = apiCode.getCode();
		this.msg = apiCode.getMsg();
	}

}
